home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-06-25 | 3.7 KB | 177 lines | [TEXT/CWIE] |
- // ===========================================================================
- // COffscreenBehavior.h ©1999 Eric Traut
- // ===========================================================================
-
- #pragma once
-
- #include "CWindowBehavior.h"
- #include "UOffscreenUtils.h"
-
-
- class COffscreenBehavior : public CWindowBehavior
- {
- public:
- COffscreenBehavior( CShadowWindow & inShadowWindow,
- Boolean inAllocateBacking,
- Boolean inDrawEveryTick = false);
-
- virtual
- ~COffscreenBehavior(void);
-
- virtual Boolean
- SyncWithShadowWindow(void);
-
- virtual void
- DoIdleTask(Boolean inGNETime);
-
- void
- AllocateNewGWorlds(void);
-
- Boolean
- GWorldNeedsSynching(void);
-
- virtual Boolean
- RenderToGWorld( StGWorldLocker & inBackingLocker,
- StGWorldLocker & inRenderingLocker);
-
- virtual Boolean
- RenderToGWorld( StGWorldLocker & inRenderingLocker);
-
- virtual void
- CopyGWorldToScreen( StGWorldLocker & inRenderingLocker);
-
- virtual void
- DetachBehavior(void);
-
- virtual Boolean
- ShouldBlitAtIdleTime(void);
-
- void
- MarkOffscreenChanged(void)
- {
- mBackingChanged = true;
- }
-
- void
- MarkOffscreenUpToDate(void)
- {
- mBackingChanged = false;
- }
-
- Boolean
- DidOffscreenChange(void)
- {
- return mBackingChanged;
- }
-
- protected:
- static void
- InitOverrideQDProcs(void);
-
- static COffscreenBehavior *
- SetUpForQDOverride( CGrafPtr inCurPort);
-
- void
- CopyPixPatParam( PixPatHandle * inSrc,
- PixPatHandle * inDest);
-
- void
- CopyPortParameters( CGrafPtr inCurPort);
-
- // Static QD bottleneck overrides
- static pascal void
- OverrideQDTextProc( short inByteCount,
- Ptr inTextBuf,
- Point inNumer,
- Point inDenom);
-
- static pascal void
- OverrideQDLineProc( Point inNewPt);
-
- static pascal void
- OverrideQDRectProc( GrafVerb inVerb,
- Rect * inRect);
-
- static pascal void
- OverrideQDRgnProc( GrafVerb inVerb,
- RgnHandle inRgn);
-
- static pascal void
- OverrideQDBitsProc( BitMap * inSrcBits,
- Rect * inSrcRect,
- Rect * inDstRect,
- short inMode,
- RgnHandle inMaskRgn);
-
- static pascal SInt16
- OverrideQDTxMeasProc( SInt16 inByteCount,
- Ptr inTextAddr,
- Point * inNumer,
- Point * inDenom,
- FontInfo * inInfo);
-
- // Overridable QD bottleneck methods
- virtual void
- DoQDBits( CGrafPtr inOrigPort,
- BitMap * inSrcBits,
- Rect * inSrcRect,
- Rect * inDstRect,
- short inMode,
- RgnHandle inMaskRgn);
-
- virtual void
- DoQDRect( CGrafPtr inOrigPort,
- GrafVerb inVerb,
- Rect * inRect);
-
- virtual void
- DoQDRgn( CGrafPtr inOrigPort,
- GrafVerb inVerb,
- RgnHandle inRgn);
-
- virtual void
- DoQDLine( CGrafPtr inOrigPort,
- Point inNewPt);
-
- virtual void
- DoQDText( CGrafPtr inOrigPort,
- short inByteCount,
- Ptr inTextBuf,
- Point inNumer,
- Point inDenom);
-
- virtual SInt16
- DoQDTxMeas( CGrafPtr inOrigPort,
- SInt16 inByteCount,
- Ptr inTextAddr,
- Point * inNumer,
- Point * inDenom,
- FontInfo * inInfo);
-
- void
- DeleteGWorlds(void);
-
- void
- EraseGWorldBackgrounds(void);
-
- Boolean mAllocateBacking;
- Boolean mDrawEveryTick;
- Boolean mBackingChanged;
- UInt32 mLastBlitTicks;
-
- Boolean mGWorldsAllocated;
- GWorldPtr mBackingGWorld;
- GWorldPtr mRenderingGWorld;
- Rect mGWorldRect;
-
- Boolean mQDProcsOverridden;
- CQDProcsPtr mOrigQDProcs;
-
- PixMapHandle mFinderOffscreen;
-
- static Boolean sOverrideQDProcsInited;
- static CQDProcs sOverrideQDProcs;
- };
-
-
-